package com.xd.pre.common;

import org.jasypt.util.text.BasicTextEncryptor;

public class Crypty {

    public static void main(String[] args) {
        BasicTextEncryptor textEncryptor = new BasicTextEncryptor();
        //加密所需的salt(盐)
        textEncryptor.setPassword("EbfYkitulv73I2p0mXI50JMXoaxZTKJ1");
        //要加密的数据（数据库的用户名或密码）
        System.out.println(textEncryptor.decrypt("upnvZ1wV5hzuS7Y8UixYJv1tsxNMUHgfnPCIY6Rh3liDh729Ro11+aCDJzI4mILg6eygkozi/NBWXIxhaAE20mS6Bi231/zR+dR66MqfCrJTKFBTLl+MRxt5BPwa6Y0rDzyeP1YOaCLc7FmZsq5uH+mkbH/xiOfbeeZhVjGBwNXhVTFqxgtb0wbgzvh996PCzMDLsT36nA+J6xtW+zgZZb3vshSCoHv3BrwiludhiV8="));
        String username = textEncryptor.encrypt("root");
        String password = textEncryptor.encrypt("52Xuguoxu");
        String url = textEncryptor.encrypt("jdbc:mysql://10.10.57.44:3336/pre?useUnicode=true&characterEncoding=UTF-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai");
        System.out.println("username:" + username);
        System.out.println("password:" + password);
        System.out.println("url:" + url);
    }
}
